const obj = {
  name: 'abc',
  age: 10
}

console.log(Object.values(obj));

console.log(Object.entries(obj));

console.log(new Map(Object.entries(obj)));
//---------------------------

const p1 = {
  first: 'LI',
  last: 'Wang',
  get fullName() {
    console.log(`------${this.first} ${this.last}`);
  }
}

//不能复制完整方法
const p2 = Object.assign({}, p1);
p2.first = 'ZHANG';


//复制完整方法
const descriptors = Object.getOwnPropertyDescriptors(p1);
const p3 = Object.defineProperties({}, descriptors);
p3.first = 'WU';
console.log(p3.fullName)

//--------------------------------

const books = {
  html: 5,
  css: 16,
  javascript: 120
}

for (const [name, count] of Object.entries(books)) {
  console.log(`${name.padEnd(16, '-')}|${count.toString().padStart(3, '0')}`)
}